using System;

namespace OffsetPath
{
    public class ClassAn : ClassAk
    {
        protected ForseArco2ClassQ a;

        public ClassAn()
        {
            this.a = new ForseArco2ClassQ();
        }

        public ClassAn(ForseArco2ClassQ A_0)
        {
            this.a = new ForseArco2ClassQ();
            this.j().MethodA(A_0);
        }

        public ClassAn(ForseLineaClassA classA0, double A_1, bool A_2, bool A_3)
        {
            this.a = new ForseArco2ClassQ();
            this.j().MethodA(classA0, A_1, A_2, A_3);
        }

        public ClassAn(PuntoDueD A_0, ClassAtPuntoIncrementale A_1, double A_2, bool A_3, bool A_4)
        {
            this.a = new ForseArco2ClassQ();
            this.j().MethodA(A_0, A_1, A_2, A_3, A_4);
        }

        public ClassAn(PuntoDueD A_0, PuntoDueD A_1, double A_2, bool A_3, bool A_4)
        {
            this.a = new ForseArco2ClassQ();
            this.j().MethodA(A_0, A_1, A_2, A_3, A_4);
        }

        public void MethodA(ClassAn A_0)
        {
            A_0.MethodA(this.j().GetLinea(), this.j().d, this.j().c, !this.j().b);
        }

        public bool MethodA(PuntoDueD A_0)
        {
            PuntoDueD puntoDueD = new PuntoDueD(this.e());
            if (A_0.MethodC(puntoDueD) > this.j().d)
            {
                return false;
            }
            if (this.j().GetLinea().MethodB(A_0))
            {
                return this.j().b;
            }
            return !this.j().b;
        }

        public void MethodA(ForseLineaClassA classA0, double A_1, bool A_2, bool A_3)
        {
            this.j().MethodA(classA0, A_1, A_2, A_3);
        }

        public void MethodA(PuntoDueD A_0, ClassAtPuntoIncrementale A_1, double A_2, bool A_3, bool A_4)
        {
            this.j().MethodA(A_0, A_1, A_2, A_3, A_4);
        }

        public void MethodA(PuntoDueD A_0, PuntoDueD A_1, double A_2, bool A_3, bool A_4)
        {
            this.j().MethodA(A_0, A_1, A_2, A_3, A_4);
        }

        public bool b()
        {
            return this.j().MethodD();
        }

        public double c()
        {
            return (this.j().GetLinea().b.c() + this.j().g());
        }

        public override double MethodC(PuntoDueD A_0)
        {
            if (this.MethodA(A_0))
            {
                return 0.0;
            }
            double num = this.j().MethodC(A_0);
            double num2 = this.j().GetLinea().MethodC(A_0);
            return Math.Min(num, num2);
        }

        public PuntoDueD d()
        {
            return this.j().GetLinea().h();
        }

        public PuntoDueD e()
        {
            return this.j().e();
        }

        public double f()
        {
            double a = this.j().MethodC();
            double d = this.j().d;
            if (this.j().c ^ this.j().b)
            {
                return (((d * d) * (a - Math.Sin(a))) / 2.0);
            }
            return ((d * d) * (ClassK.s - ((a - Math.Sin(a)) / 2.0)));
        }

        public override void f(ClassAb A_0)
        {
            this.j().f(A_0);
        }

        ~ClassAn()
        {
        }

        public ForseArco2ClassQ j()
        {
            return this.a;
        }

        public PuntoDueD k()
        {
            return this.j().GetLinea().i();
        }

        public override void k(ForseLineaClassA classA0, ClassAj A_1)
        {
            this.j().k(classA0, A_1);
            ClassAj classAj = new ClassAj();
            this.j().GetLinea().k(classA0, classAj);
            A_1.MethodB(classAj);
        }

        public PuntoDueD l()
        {
            double num = this.j().MethodC();
            bool flag = this.j().b == this.j().c;
            double d = this.j().d;
            double num3 = d * d;
            double num4 = num3 * ClassK.s;
            double num5 = num3 * ((num - Math.Sin(num)) / 2.0);
            double num6 = this.j().GetLinea().g();
            double num7 = num5 / num6;
            PuntoDueD puntoDueD = new PuntoDueD(this.j().GetLinea().p());
            PuntoDueD x2 = new PuntoDueD(this.j().e());
            ForseLineaClassA classA = new ForseLineaClassA(puntoDueD, x2);
            classA.b.d();
            classA.b.MethodA((double) (num7 / 2.0));
            if (flag)
            {
                PuntoDueD x3 = new PuntoDueD(classA.i());
                x2.MethodA(num4);
                x3.MethodA(num5);
                PuntoDueD x4 = PuntoDueD.MethodA(x2, x3);
                x4.MethodA((double) (1.0 / (num4 - num5)));
                return x4;
            }
            return classA.i();
        }

        public override void l(ClassAtPuntoIncrementale A_0, ClassAj A_1)
        {
            this.j().l(A_0, A_1);
            ClassAj classAj = new ClassAj();
            this.j().GetLinea().l(A_0, classAj);
            A_1.MethodB(classAj);
        }

        public double n()
        {
            return this.j().g();
        }

        public override void n(ClassAg A_0)
        {
            this.j().n(A_0);
        }

        public double o()
        {
            if (!this.b())
            {
                return 0.0;
            }
            return this.j().MethodC();
        }

        public override void o(double A_0, PuntoDueD A_1)
        {
            this.j().o(A_0, A_1);
        }

        public ForseLineaClassA p()
        {
            return new ForseLineaClassA(this.j().GetLinea());
        }

        public override void p(ClassAtPuntoIncrementale A_0)
        {
            this.j().p(A_0);
        }

        public double q()
        {
            if (this.j().b)
            {
                return this.f();
            }
            return -this.f();
        }

        public override void q(ForseLineaClassA classA0)
        {
            this.j().q(classA0);
        }

        public override void r(PuntoDueD A_0)
        {
            this.j().r(A_0);
        }

        public override void GetStartPoint(double A_0, PuntoDueD A_1)
        {
            this.j().GetStartPoint(A_0, A_1);
        }
    }
}

